home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / comms / other / hurl! / install < prev    next >
Text File  |  1999-06-14  |  5KB  |  200 lines

  1. ; A General Installation Script
  2. ; Copyright © 1998 by Ralph Torchia
  3. ; $VER:GenInstallScript v1.1 (16.09.1998)
  4. ; $DESCRIPTION: Customized for Hurl v2 - Install v1.8 (10.04.1999)
  5.  
  6. (set @PRGVersion "1.8")
  7.  
  8. ;-------------- Get Current Hurl version  ---------------
  9. (set vernum_new (getversion "hurl"))
  10. (set ver_new (/ vernum_new 65536))
  11. (set rev_new (- vernum_new (* ver_new 65536) ) )
  12.  
  13. ;-------------- Introduce Ourselves ------------------
  14. (welcome
  15.   ("\nWelcome!\n\n")
  16.   ("    This script will copy the program Hurl\nto your system.\n")
  17.   ("    Please follow the intaller's instruction to install\n\n")
  18. )
  19.  
  20. ;-------------- Are we installing for YAM only? ---------------
  21. (set #yamchoice
  22.   (askchoice
  23.     (prompt "Do you want to install Hurl only for YAM?")
  24.     (help @askchoice-help)
  25.     (choices "Yes"
  26.              "No")
  27.     (default 0)
  28.   )
  29. )
  30.  
  31. ;-------------- Choice #1 = Install to YAM: directory ---------------
  32. (if (= #yamchoice 0)
  33.  (
  34.   (set #homedir "YAM:")
  35.  
  36.   (if (not (exists #homedir (noreq)))
  37.     (
  38.       (set #homedir
  39.         (askdir
  40.           (prompt "Where is the program YAM located?")
  41.           (help " Please locate the YAM directory. (The main program YAM is located within it).")
  42.           (default #homedir)
  43.         )
  44.       )
  45.     )
  46.   )
  47.  
  48.   (set @default-dest (tackon #homedir "Rexx/"))
  49.   (set @hurlfile-dest (tackon @default-dest "Hurl"))
  50.  
  51.   (if (not (exists @default-dest (noreq)))
  52.     (
  53.       (makedir @default-dest
  54.         (prompt "Directory "@default-dest" does not exist!\nCreate it now?")
  55.         (help "YAM places all its scripts within the Rexx folder.  Proceeding with this installation will result in the YAM:Rexx folder being created.")
  56.         (confirm 0)
  57.       )
  58.     )
  59.   )
  60.  
  61.   (set vernum_old (getversion @hurlfile-dest))
  62.   (set ver_old (/ vernum_old 65536))
  63.   (set rev_old (- vernum_old (* ver_old 65536) ) )
  64.   (message
  65.     ("You are about to install Hurl version %ld.%ld.\n" ver_new rev_new)
  66.     ("You currently have version %ld.%ld installed" ver_old rev_old)
  67.    )
  68.  
  69.   (if (exists @default-dest (noreq))
  70.       (
  71.         (copyfiles
  72.           (prompt "Copying Hurl to " @default-dest)
  73.           (help @copyfiles-help)
  74.           (source "Hurl")
  75.           (dest @default-dest)
  76.           (files)
  77.         )
  78.       )
  79.   )
  80.  
  81.   (if (exists @hurlfile-dest (noreq))
  82.    (
  83.     (set #mode
  84.       (askchoice
  85.         (prompt "Do you want to configure YAM for Hurl?")
  86.         (help @askchoice-help)
  87.         (choices "Yes - Configure YAM for Hurl usage"
  88.                  "Yes - Configure YAM and set Hurl to auto mode"
  89.                  "No  - I'll do it myself!")
  90.         (default 0)
  91.       )
  92.     )
  93.  
  94.     (if (= #mode 0)
  95.       ((rexx "configyam4hurl.rexx"))
  96.     )
  97.  
  98.     (if (= #mode 1)
  99.       ((rexx "configyam4hurl.rexx auto"))
  100.     )
  101.  
  102.     (set #yamsize (getsize "YAM:YAM"))
  103.     (if (= #yamsize 523612)
  104.       (
  105.         (set #patch
  106.           (askchoice
  107.             (prompt "YAM v2p7 has a bug which prevents the use of Hurl.  Would you like to patch YAM right now? (NOTE: If your copy of YAM2p7 is already patched, then doing this a second time will unpatch YAM)")
  108.             (help @askchoice-help)
  109.             (choices "Yes"
  110.                      "No")
  111.             (default 0)
  112.           )
  113.         )
  114.         (if (= #patch 0)
  115.           ((run "YamOpenURLPatch"))
  116.         )
  117.       )
  118.     )
  119.    )
  120.   )
  121.  
  122.   (if (not (exists @hurlfile-dest (noreq)))
  123.     ((abort "You did not locate the YAM directory and program correctly!\nPlease try again...\n"))
  124.   )
  125.  )
  126. )
  127.  
  128. ;-------------- Choice #2 = Install to User's system instead ---------------
  129. (if (= #yamchoice 1)
  130.  (
  131.   (set #homedir "c:")
  132.   (set #homedir
  133.     (askdir
  134.       (prompt "Where do you want to install Hurl to?")
  135.       (help "Please choose a dirctory to install Hurl to.  C: is a good choice.")
  136.       (default #homedir)
  137.     )
  138.   )
  139.  
  140.   (set vernum_old (getversion (tackon #homedir "Hurl")))
  141.   (set ver_old (/ vernum_old 65536))
  142.   (set rev_old (- vernum_old (* ver_old 65536) ) )
  143.   (message
  144.     ("You are about to install Hurl version %ld.%ld.\n" ver_new rev_new)
  145.     ("You currently have version %ld.%ld installed" ver_old rev_old)
  146.    )
  147.  
  148.   (if (exists #homedir (noreq))
  149.     (
  150.       (set @default-dest #homedir)
  151.       (copyfiles
  152.         (prompt "Copying Hurl to " @default-dest)
  153.         (help @copyfiles-help)
  154.         (source "Hurl")
  155.         (dest @default-dest)
  156.         (files)
  157.       )
  158.     )
  159.   )
  160.  )
  161. )
  162.  
  163. ;-------------- Install Hurl.guide? ---------------
  164. (set #guidechoice
  165.   (askchoice
  166.     (prompt "Do you want to install the Hurl Guide file?")
  167.     (help @askchoice-help)
  168.     (choices "Yes"
  169.              "No")
  170.     (default 0)
  171.   )
  172. )
  173.  
  174. (if (= #guidechoice 0)
  175.   (
  176.     (set #guidedir "Help:")
  177.     (set #guidedir
  178.       (askdir
  179.         (prompt "Where do you want to install Hurl.guide to?")
  180.         (help "Please choose a dirctory to install Hurl.guide to.  Help: is a good choice.")
  181.         (default #guidedir)
  182.       )
  183.     )
  184.    (if (exists #guidedir (noreq))
  185.      (
  186.        (copyfiles
  187.          (prompt "Copying Hurl.guide to " #guidedir)
  188.          (help @copyfiles-help)
  189.          (source "Hurl.guide")
  190.          (dest #guidedir)
  191.          (files)
  192.        )
  193.      )
  194.    )
  195.   )
  196. )
  197.  
  198. (exit "Done installing Hurl.\n\nRemember, this is Emailware!")
  199.  
  200.